package edu.study.common.exception;

import edu.study.api.common.enums.BaseResultCodeEnum;
import lombok.Getter;
import lombok.Setter;

import java.text.ParseException;

@Getter
@Setter
public class BizException extends RuntimeException {
    private String code;
    private String message;
    private String status;

    protected BizException() {
        
    }

    public BizException(String code, String message, String status) {
        this.code = code;
        this.message = message;
        this.status = status;
    }

    public BizException(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public BizException(BaseResultCodeEnum baseResultCode) {
        this.code = baseResultCode.getCode();
        this.message = baseResultCode.getMessage();
    }

    public BizException(BaseResultCodeEnum baseResultCode, String message) {
        this.code = baseResultCode.getCode();
        this.message = baseResultCode.getMessage() + " | " + message;
    }

    public BizException(String code, String message, ParseException e) {
        super(e);
        this.code = code;
        this.message = message;
    }
}
